package com.qf.springcloud.fallback;

import com.netflix.discovery.converters.Auto;
import com.qf.springcloud.client.ProducerClient;
import feign.hystrix.FallbackFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class ProducerFallbackFactory implements FallbackFactory<ProducerClient> {


    @Autowired
    private ProducerFallBack producerFallBack;

    @Override
    public ProducerClient create(Throwable cause) {
        cause.printStackTrace();
        return producerFallBack;
    }
}
